/**
 * 更多页面
 */
import React, {Component} from 'react';
import {View, StyleSheet, Text, Image, Platform, TouchableOpacity, ScrollView,Linking} from  'react-native';
import  MoreCommonCell from './MoreCommonCell';
import  BadInstagramCloneApp from './BadInstagramCloneApp';
import Icon from 'react-native-vector-icons/FontAwesome';
let ImageSetting = require('../../img/icon_mine_setting.png');
export default class More extends Component {
    render() {
        return (
            <View style={styles.container}>
                {this.renderNavBar()}
                <ScrollView>
                    <View style={{marginTop:20}}>
                        <MoreCommonCell title="扫一扫" func={()=>this._onPressButton()}/>
                    </View>

                    <View style={{marginTop:20}}>
                        <MoreCommonCell title="省流量模式" isSwitch={true}/>
                        <MoreCommonCell title="消息提醒"/>
                        <MoreCommonCell title="邀请好友"/>
                        <MoreCommonCell title="清空缓存" rightTitle="10.3M"/>
                    </View>

                    <View style={{marginTop:20}}>
                        <MoreCommonCell title="关于我们"/>
                        <MoreCommonCell title="意见反馈"/>
                        <MoreCommonCell title="问卷调查"/>
                        <MoreCommonCell title="支付帮助"/>
                        <MoreCommonCell title="网络诊断"/>
                    </View>

                    <View style={{marginTop:20}}>
                        <MoreCommonCell title="机器助手"/>
                        <MoreCommonCell title="联系客服" rightTitle="400-844-1919" func={this._call}/>
                    </View>
                </ScrollView>
            </View>
        )
    }

    renderNavBar() {
        return (
            <View style={styles.navStyle}>
                <Text style={{color:'white',fontSize:16,fontWeight:'bold'}}>更多</Text>
                <TouchableOpacity onPress={()=>{alert("aa")}} style={styles.rightViewStyle}>
                    <Icon name="tasks" size={16} color="white"/>
                </TouchableOpacity>
            </View>
        )
    }

    _onPressButton() {
        const { navigate } = this.props.navigation;
        navigate('BadInstagramCloneApp');
        // const {navigator} = this.props;
        // if (navigator) {
        //     navigator.push({
        //         component: BadInstagramCloneApp,
        //         name: 'BaiduMap',
        //         params: {
        //             // tabBar: {
        //             //     hide: () => this.props.tabBar.hide(),
        //             //     show: () => this.props.tabBar.show()
        //             // }
        //         }
        //     })
        // }
    }

    _call(){
        return Linking.openURL('tel:4008441919')
    }
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#e8e8e8',
    },
    navStyle: {
        height: Platform.OS == 'ios' ? 64 : 44,
        backgroundColor: 'rgba(255,96,0,1.0)',
        flexDirection: 'row',
        alignItems: 'center',
        justifyContent: 'center'
    },
    rightViewStyle: {
        position: 'absolute',
        right: 10,
        bottom: 13
    }
});
